<template>
  <div class="layout">
    <div>
      <NewBanner
        :image="require('@/assets/image/index/background2.png')"
        @jump="$router.push({ path: 'service' })"
        style="height: 500px"
      ></NewBanner>
      <!-- 第二块 -->
      <NewestBar></NewestBar>
      <!-- 第三块 -->
      <Container
        ref="rencai"
        className="supportCase_box"
        title="人才服务"
        @jump="$router.push({ path: 'help' })"
      >
        <template>
          <SupportCaseBox :supportCaseList="supportCaseList"></SupportCaseBox>
        </template>
      </Container>
      <!-- 第四块 -->
      <Container
        className="financeProduct"
        title="金融产品服务"
        @jump="$router.push({ path: 'finance' })"
      >
        <template>
          <FinanceProductBox
            :objList="objList"
            :pubList="pubList"
          ></FinanceProductBox>
        </template>
      </Container>
      <!-- 第五块 -->
      <Container
        className="enterprise_box"
        title="融资案例公示"
        @jump="$router.push({ path: 'finance' })"
      >
        <template>
          <EnterpriseBox :pagesize="3"></EnterpriseBox>
        </template>
      </Container>
      <FloatBar></FloatBar>
    </div>
  </div>
</template>

<script>
import { request } from "@/utils/request.js";
import { host } from "@/utils/config.js";
import NewestBar from "@/components/newestBar";
import FloatBar from "@/components/floatBar";
import Container from "@/components/container";
import SupportCaseBox from "./components/supportCaseBox";
import FinanceProductBox from "./components/financeProductBox";
import EnterpriseBox from "@/components/enterpriseBox";

export default {
  name: "index",
  components: {
    NewestBar,
    FloatBar,
    Container,
    SupportCaseBox,
    EnterpriseBox,
    FinanceProductBox,
  },
  data() {
    return {
      typeList: [],
      statusList: [],
      objList: [],
      pubList: [],
      supportCaseList: [],
    };
  },
  created() {
    this.gettypeList();
  },
  methods: {
    // 字典查询 政策类别
    async gettypeList() {
      let api = `finance_financing_turn,finance_com_financing_status,finance_product_object,finance_publish_department`;
      // 调用公共方法中的查询字典表
      this.getDictList(this, api).then((res) => {
        //  融资的轮次
        this.typeList = res.finance_financing_turn;
        //  融资状态
        this.statusList = res.finance_com_financing_status;
        // 适用对象
        this.objList = res.finance_product_object;
        console.log("this.objList", this.objList);
        // 发布部门
        this.pubList = res.finance_publish_department;
      });
    },
  },
};
</script>
